Generally caching of block device data at a relatively lower latency device provides phenomenal performance for both read and write input/output (“I/O”) operations. As a read cache device, the data is stored in the cache device until it is replaced with the new data. Until then, the data is read from the cache device for subsequent read I/O operations directed to the same data block. As a write cache, the new data is written to the cache device, and the write I/O operation is informed completed. Later based on policy, the dirty data stored in the cache device is actually persisted to the underlying stable medium.
A solid state device (“SSD”) can be used as the cache device. When compared to a hard disk drive, SSD devices have superior read and write performance. It is therefore desirable to maximize use of the SSD device as the cache device to achieve a greater performance advantage. In addition to having superior read and write performance, the SSD cache device typically has a larger capacity than conventional cache devices. This combination results in more complex management issues. For example, a cache medium includes a plurality of cache lines for caching data stored in the underlying data storage medium. Cache headers are provided and maintained to manage the cache lines. When servicing I/O operations, the cache headers are searched to determine whether there is a cache hit or miss. However, by maximizing use of a larger capacity cache device, more cache lines are available for caching data, and therefore more cache headers must be searched. Accordingly, the complexity of the cache header search is increased. Additionally, in case of a cache miss, it is desirable to use proper cache replacement logic to avoid swapping more-frequently accessed or more-recently accessed data out of the cache device. Swapping more-frequently accessed or more-recently accessed data out of the cache device leads to poor system performance because more and more cache misses will occur. In conventional data storage systems, least-recently used (LRU) or least-frequently used (LFU) cache replacement logic is employed to replace the old data.